package com.smart.campus.school.service.impl;

import java.util.List;
import com.smart.campus.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.campus.school.mapper.RoomInfoMapper;
import com.smart.campus.school.domain.RoomInfo;
import com.smart.campus.school.service.IRoomInfoService;
import com.smart.campus.common.core.text.Convert;

/**
 * 教室信息Service业务层处理
 * 
 * @author Zhihe.Li
 * @date 2020-06-28
 */
@Service
public class RoomInfoServiceImpl implements IRoomInfoService 
{
    @Autowired
    private RoomInfoMapper roomInfoMapper;

    /**
     * 查询教室信息
     * 
     * @param id 教室信息ID
     * @return 教室信息
     */
    @Override
    public RoomInfo selectRoomInfoById(Long id)
    {
        return roomInfoMapper.selectRoomInfoById(id);
    }

    /**
     * 查询教室信息列表
     * 
     * @param roomInfo 教室信息
     * @return 教室信息
     */
    @Override
    public List<RoomInfo> selectRoomInfoList(RoomInfo roomInfo)
    {
        return roomInfoMapper.selectRoomInfoList(roomInfo);
    }

    /**
     * 新增教室信息
     * 
     * @param roomInfo 教室信息
     * @return 结果
     */
    @Override
    public int insertRoomInfo(RoomInfo roomInfo)
    {
        roomInfo.setCreateTime(DateUtils.getNowDate());
        return roomInfoMapper.insertRoomInfo(roomInfo);
    }

    /**
     * 修改教室信息
     * 
     * @param roomInfo 教室信息
     * @return 结果
     */
    @Override
    public int updateRoomInfo(RoomInfo roomInfo)
    {
        roomInfo.setUpdateTime(DateUtils.getNowDate());
        return roomInfoMapper.updateRoomInfo(roomInfo);
    }

    /**
     * 删除教室信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRoomInfoByIds(String ids)
    {
        return roomInfoMapper.deleteRoomInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除教室信息信息
     * 
     * @param id 教室信息ID
     * @return 结果
     */
    @Override
    public int deleteRoomInfoById(Long id)
    {
        return roomInfoMapper.deleteRoomInfoById(id);
    }
}
